
def login():
    lg = bs.login()
    if  lg.error_code != '0':
        print("Loging failed. Error code: " + lg.error_code)
        print("Loging failed. Error code: " + lg.error_msg)
        return None
    return lg

def is_codename_valide(code):
    if len(code) != 9 or (code[:2] != 'SH' and code[:2] != 'SZ') or not code[3:9].isdigit():
        print(f'Code "{code}" is not correct.')
        return False
    return True